﻿CREATE TABLE [dbo].[Participant]
(
    [ParticipantId] [uniqueidentifier] DEFAULT newid() NOT NULL,
	[Activity] [uniqueidentifier] NOT NULL, -- FK to Activity
	[Person] [uniqueidentifier] NULL, -- FK to Person
	[BusinessRole] [uniqueidentifier] NULL, -- FK to BusinessRole
    [CreatedBy] [uniqueidentifier] NOT NULL, -- FK to Person
    [IsDeleted] [bit] DEFAULT 0 NOT NULL,
	[CreatedOn] [datetime] DEFAULT getdate() NOT NULL,
    [LastChanged] [datetime] DEFAULT getdate() NOT NULL,
	[LastChangedBy] [uniqueidentifier] NOT NULL, -- FK to Person
	[TimeStamp] [timestamp] NOT NULL

CONSTRAINT [PK_Participant] PRIMARY KEY CLUSTERED 
(
    [ParticipantId] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY],
-- CONSTRAINT [UNIQUE_ActivityParticipant] UNIQUE (
--    [Activity],
--    [Person]
--) ON [PRIMARY]
) ON [PRIMARY]
GO